/**
 * 系统字典
 */

import { toSuccess, useTransaction } from "@sker/core"
export default async () => {
    const res = useTransaction(async (m) => {
        const list = await m.find(`sys_code`, { where: { status: true } })
        const code = {}
        list.map((item: any) => {
            Reflect.set(code, item.key, item.value)
        })
        return code;
    })
    return toSuccess(res)
}